//
//  RecordView.m
//  hnGovernment
//
//  Created by 安仔 on 17/3/3.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "RecordView.h"

@interface RecordView ()

@property (nonatomic, strong) UIView *topLine;
@property (nonatomic, strong) UIView *bottomLien;
@property (nonatomic, strong) UILabel *leftLab;

@end

@implementation RecordView

- (instancetype) initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor whiteColor];
        self.layer.cornerRadius = 10 * m6Scale;
        [self createRecordView];
    }
    return self;
}

- (void)createRecordView {
    
    
    self.titleLab = [[UILabel alloc] init];
    self.titleLab.text = NSLocalString(@"婚姻登记预约");
    self.titleLab.textColor = APPColor;
    self.titleLab.font = [UIFont systemFontOfSize:32 * m6Scale];
    self.titleLab.textAlignment = NSTextAlignmentCenter;
    [self addSubview:self.self.titleLab];
    [self.titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.mas_equalTo(32 * m6Scale);
        make.bottom.mas_equalTo(-330 * m6Scale);
    }];
    
    
    self.topLine = [[UIView alloc] init];
    self.topLine.backgroundColor = APPColor;
    [self addSubview:self.topLine];
    [self.topLine mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.mas_equalTo(100 * m6Scale);
        make.size.mas_equalTo(CGSizeMake(self.frame.size.width, 2 * m6Scale));
    }];
    
    
    self.moneyLab = [[UILabel alloc] init];
    self.moneyLab.text = @"¥500";
    self.moneyLab.textColor = APPColor;
    self.moneyLab.font = [UIFont systemFontOfSize:76 * m6Scale];
    self.moneyLab.textAlignment = NSTextAlignmentCenter;
    self.moneyLab.hidden = YES;
    [self addSubview:self.moneyLab];
    [self.moneyLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.mas_equalTo(170 * m6Scale);
        make.bottom.mas_equalTo(-155 * m6Scale);
    }];
    
    
    self.contentLab = [[UILabel alloc] init];
    self.contentLab.text = NSLocalString(@"老舍（1899年2月3日—1966年8月24日），原名舒庆春，字舍予，现代著名作家、人民艺术家、杰出的语言大师，被誉为“人民艺术家”。老舍是满族正红旗人，北京人，父亲是一名满族的护军，阵亡在八国联军攻打北京城的时候。");
    self.contentLab.textColor = RGB(103, 103, 103);
    self.contentLab.font = [UIFont systemFontOfSize:24 * m6Scale];
    self.contentLab.backgroundColor = [UIColor clearColor];
    self.contentLab.numberOfLines = 0;
    [self addSubview:self.contentLab];
    [self.contentLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(20*m6Scale);
        make.top.mas_equalTo(130 * m6Scale);
        make.right.mas_equalTo(self.mas_right).offset(-20*m6Scale);
    }];
    

    self.bottomLien = [[UIView alloc] init];
    self.bottomLien.backgroundColor = RGB(243, 243, 243);
    [self addSubview:self.bottomLien];
    [self.bottomLien mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self.mas_centerX);
        make.top.mas_equalTo(316 * m6Scale);
        make.size.mas_equalTo(CGSizeMake(710 * m6Scale, 2 * m6Scale));
    }];
    
    self.leftLab = [[UILabel alloc] init];
    self.leftLab.text = NSLocalString(@"更新时间：");
    self.leftLab.textColor = RGB(103, 103, 103);
    self.leftLab.font = [UIFont systemFontOfSize:24 * m6Scale];
    self.leftLab.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.leftLab];
    [self.leftLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentLab.mas_left);
        make.bottom.mas_equalTo(self.mas_bottom).offset(-24 * m6Scale);
        make.size.mas_equalTo(CGSizeMake(125 * m6Scale, 34 * m6Scale));
    }];
    
    self.timeLab = [[UILabel alloc] init];
    self.timeLab.text = NSLocalString(@"09-21 16:00");
    self.timeLab.textColor = RGB(103, 103, 103);
    self.timeLab.font = [UIFont systemFontOfSize:24 * m6Scale];
    self.timeLab.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.timeLab];
    [self.timeLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.leftLab.mas_right);
        make.centerY.mas_equalTo(self.leftLab.mas_centerY);
//        make.size.mas_equalTo(CGSizeMake(160 * m6Scale, 34 * m6Scale));
    }];

    
    self.rightLab = [[UILabel alloc] init];
    self.rightLab.text = NSLocalString(@"省发改委");
    self.rightLab.textColor = RGB(103, 103, 103);
    self.rightLab.font = [UIFont systemFontOfSize:24 * m6Scale];
    self.rightLab.textAlignment = NSTextAlignmentRight;
    [self addSubview:self.rightLab];
    [self.rightLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.mas_equalTo(self.mas_right).offset(-30 * m6Scale);
        make.centerY.mas_equalTo(self.leftLab.mas_centerY);
    }];

    
}



@end
